import 'package:share_fit/app/controllers/base/base_controller.dart';
import 'package:share_fit/app/controllers/device/measure/measure_state.dart';

class MeasureLogic extends BaseController {

  final MeasureState state = MeasureState();

  void switchMeasure(bool value) {
    state.switchValue = value;
    update(["measure_switch"]);
  }

  void switchHeart(bool value) {
    state.heartValue = value;
    update(["heart_switch"]);
  }

  void switchOxygen(bool value) {
    state.oxygenValue = value;
    update(["oxygen_switch"]);
  }

  void switchBloodPressure(bool value) {
    state.bloodPressureValue = value;
    update(["blood_pressure_switch"]);
  }

  void switchSugar(bool value) {
    state.sugarValue = value;
    update(["suger_switch"]);
  }

  void switchPressure(bool value) {
    state.pressureValue = value;
    update(["pressure_switch"]);
  }

  void switchTemp(bool value) {
    state.tempValue = value;
    update(["temp_switch"]);
  }

  void switchMet(bool value) {
    state.metValue = value;
    update(["met_switch"]);
  }

  void switchFatigue(bool value) {
    state.fatigueValue = value;
    update(["fatigue_switch"]);
  }

  bool switchLogic(String id) {
    switch(id) {
      case "heart_switch":
        return state.heartValue;
      case "oxygen_switch":
        return state.oxygenValue;
      case "blood_pressure_switch":
        return state.bloodPressureValue;
      case "suger_switch":
        return state.sugarValue;
      case "pressure_switch":
        return state.pressureValue;
      case "temp_switch":
        return state.tempValue;
      case "met_switch":
        return state.metValue;
      case "fatigue_switch":
        return state.fatigueValue;
      default:
        return false;
    }
  }

  void switchAll(bool value) {
    switchHeart(value);
    switchOxygen(value);
    switchBloodPressure(value);
    switchSugar(value);
    switchPressure(value);
    switchTemp(value);
    switchMet(value);
    switchFatigue(value);
  }

  @override
  String getRemotePath() {
    return "";
  }

  @override
  void initState() {
    // TODO: implement initState
  }

  @override
  void onRemoteEvent(event, method) {
    // TODO: implement onRemoteEvent
  }
}
